package edu.nf.controller.room;

import edu.nf.controller.BaseController;
import edu.nf.hotel.roominfo.RoomInfo;
import edu.nf.hotel.roominfo.RoomInfoDao;
import edu.nf.hotel.roominfodao.impl.RoomInfoDaoImpl;
import edu.nf.hotel.userdao.UserDao;
import edu.nf.hotel.userdao.impl.UserDaoImpl;
import edu.nf.hotel.vo.PageVO;
import edu.nf.hotel.vo.ResultVO;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

import java.util.List;

/**
 * @Date 2023-06-27
 * @Author 带土
 */
public class RoomInfoController extends BaseController {

    private static ResultVO<Object> resultVO = null;

    @RequestMapping("/room/listName")
    public View selectName(@RequestParam("cityName") String cityName){
        RoomInfoDao dao = new RoomInfoDaoImpl();
        ResultVO<Object> resultVO1 = new ResultVO<>(200,"成功",dao.getAllName(cityName));
        return new JsonView(resultVO1);
    }

    /**
     * 查询客房所有信息
     * @return
     */
    @RequestMapping("/room/getRoom")
    public View getRoom(){
        RoomInfoDao dao = new RoomInfoDaoImpl();
        ResultVO<Object> resultVO1 = new ResultVO<>(0,"成功",dao.getAllRoomInfo());
        return new JsonView(resultVO1);
    }

}
